package logic

import (
	"cart_srv/model/redis"
	"context"

	"cart_srv/cart"
	"cart_srv/internal/svc"

	"github.com/zeromicro/go-zero/core/logx"
)

type DelGoodsLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewDelGoodsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DelGoodsLogic {
	return &DelGoodsLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *DelGoodsLogic) DelGoods(in *cart.DelGoodsRequest) (*cart.DelGoodsResponse, error) {
	// todo: add your logic here and delete this line
	redis.DelGoods(in.UserId, in.GoodsId)
	return &cart.DelGoodsResponse{}, nil
}
